package com.yoda.mall.admin.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yoda.mall.api.CouponHistoryApi;
import com.yoda.mall.model.entity.sms.Coupon;
import com.yoda.mall.model.entity.sms.CouponHistory;
import com.yoda.mall.model.vo.PageResult;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class CouponHistoryService {
    @DubboReference
    private CouponHistoryApi couponHistoryApi;
    public PageResult<CouponHistory> couponHistoryListPage(Long couponId, String orderSn, Integer pageNum, Integer pageSize, Integer useStatus) {
        Page<CouponHistory> page = couponHistoryApi.getCouponHistoryListPage(couponId,orderSn, pageNum, pageSize, useStatus);
        return new PageResult<>((int) page.getCurrent(), (int) page.getSize(), (int) page.getTotal(), page.getRecords());
    }
}
